import type { DonationPage, DonationType, DonationVo, School } from '@/types/home'
import type { TableDataInfo } from '@/types/global'
import { http } from '@/utils/http'
/**
 * 分页查询捐赠物
 * @param data
 * @returns
 */
export const getDonationListAPI = (data: DonationPage) => {
  return http<TableDataInfo<DonationVo>>({
    url: `/donation/list/${data.schoolId}?pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
    method: 'GET',
    data: data.donation,
  })
}

/**
 *查询捐赠物种类列表
 * @returns
 */
export const getDonationTypeAPI = () => {
  return http<TableDataInfo<DonationType>>({
    url: `/donationType/list`,
    method: 'GET',
  })
}

/**
 * 获取学校列表
 * @returns
 */
export const getSchoolListAPI = () => {
  return http<TableDataInfo<School>>({
    url: `/school/list`,
    method: 'GET',
  })
}
